package com.ylpms.agme.dao;

import com.ylpms.agme.entity.AgmeBizEntity;
import com.ylpms.agme.entity.PubertyInfoEntity;
import com.ylpms.user.dao.UserDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

/***
 * 生育期数据操作接口
 * add by heyao 2019.01.20
 */
@Mapper
public interface PubertyDao {
    @SelectProvider(type= PubertyDao.TutorDynaSqlProvider.class, method="findBySql")
    PubertyInfoEntity getPubertyInfo(int regionid,String cropcode, String time);

    public class TutorDynaSqlProvider{
        public String findBySql(int regionid,String cropcode, String time){
            String year = time.substring(0,4);
            String month = time.substring(4,2);
            String day = time.substring(6,2);
            int int_year = Integer.parseInt(year);
            int int_month = Integer.parseInt(month);
            int int_day = Integer.parseInt(day);





            String sql = "select * from t_agme_pubertyinfo pi left join t_agme_puberty p on p.code=pi.pubertycode where ";
            return sql;
        }
    }
}
